package hanxx.test.one;

/**
 * @edit:韩鑫鑫
 * @Date: 2022/11/18/11:53
 * @Description:
 */
public class StudyString {
    public static void main(String[] args) {
        /*String s1 = "abccccccccccc";
        String s2 = "abccccccccccc";
        System.out.println(s1 == s2);
        String s3 = new String("abcc");
        String s4 = new String("abcc");
        System.out.println(s3 == s4);*/

        /*String s1 = "javaEE";
        String s2 = "hadoop";
        String s3 = "javaEEhadoop";
        String s4 = "javaEE" + "hadoop";
        String s5 = s1 + "hadoop";
        String s6 = "javaEE" + s2;
        String s7 = s1 + s2;
        System.out.println(s3 == s4);//true
        System.out.println(s3 == s5);//false
        System.out.println(s3 == s6);//false
        System.out.println(s3 == s7);//false
        System.out.println(s5 == s6);//false
        System.out.println(s5 == s7);//false
        System.out.println(s6 == s7);//false
        String s8 = s6.intern();//返回值得到的s8使用的常量值中已经存在的“javaEEhadoop”
        System.out.println(s3 == s8);//true*/

        /*String s1 = "javaEEhadoop";
        String s2 = "javaEE";
        String s3 = s2 + "hadoop";
        System.out.println(s1 == s3);//false
        final String s4 = "javaEE";//s4:常量
        String s5 = s4 + "hadoop";
        System.out.println(s1 == s5);//true*/

        /*String str1 = "abc123";  //题目： a21cb3
        char[] charArray = str1.toCharArray();
        for (int i = 0; i < charArray.length; i++) {
            System.out.println(charArray[i]);
        }*/
    }
}
